programming:c:function strrchrWhat links here?
Defined in string.h.

Find last occurrence of character in string.
Returns the last occurrence of c in string.
The null-terminating character is included as part of the string and can also be searched.

Parameters.

Return Value.

Portability.



 const char * strrchr ( const char * string, int c );
       char * strrchr (       char * string, int c );
Both have the same behavior as the original declaration.

Example.

/* strrchr example */
  1. include
  2. include


int main () { char str[] = "This is a sample string"; char * pch; pch=strrchr(str,'s'); printf ("Last occurence of 's' found at %d \n",pch-str+1); return 0; }


Output: Last occurrence of 's' found at 18

See also.
strchr, strcspn, strcmp, strstr, memchr

From http://www.cplusplus.com/ref/
programming:c:function strrchr
filename:programming:c:function strrchr
filename:programming%3Ac%3Afunction%20strrchr
last edit:March 29 2009 21:08:34 (5516 days ago)
ct = 1714961746.000000 = May 05 2024 22:15:46
ft = 1238375314.000000 = March 29 2009 21:08:34
dt = 476586432.000000